package com.javasm.sys.impl;

import com.javasm.sys.TasksService;
import com.javasm.sys.dao.TaskDao;
import com.javasm.sys.SysTimingTask;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class TasksServiceImpl implements TasksService {
    @Resource
    private TaskDao taskDao;
    @Override
    public List<SysTimingTask> getRunningTasks() {

       return taskDao.getRunningTasks();
    }

    @Override
    public boolean stopTask(String taskid) {
        return taskDao.stopTask(taskid);
    }

    @Override
    public boolean startTask(String taskid) {
        return taskDao.startTask(taskid);
    }

    @Override
    public SysTimingTask getById(String taskid) {
        return taskDao.getById(taskid);
    }

    @Override
    public List<SysTimingTask> getTasks(SysTimingTask sysTimingTask) {
        return taskDao.getTasks(sysTimingTask);
    }

    @Override
    public Integer updateTaskById(SysTimingTask sysTimingTask) {
        return taskDao.updateTaskById(sysTimingTask);
    }

    @Override
    public Integer delTaskById(String taskId) {
        return taskDao.delTaskById(taskId);
    }

    @Override
    public Integer addTask(SysTimingTask sysTimingTask) {
        return taskDao.addTask(sysTimingTask);
    }

}
